<template>
    <div class="tableBottom flexC mt10" v-if="!noPage">
        <!-- <el-pagination
                ref="page"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :page-sizes="page.page_sizes"
                :page-size="page.page_size"
                layout="total, sizes, prev, pager, next, jumper"
                :current-page="cPage"
                :total="total">
        </el-pagination> -->
		<el-pagination
		        ref="page"
				layout="total, sizes, prev, pager, next, jumper"
				@current-change="handleCurrentChange"
		        :total="total">
		</el-pagination>
    </div>
</template>

<script>
    // import {mapGetters, mapMutations} from 'vuex'

    export default {
        name: "page",
        props: ['total', 'noPage'],
        computed: {
            // ...mapGetters(['page', 'currentPage']),
        },
        created() {
            // this.cPage = this.$route.query.page ? Number(this.$route.query.page) : 1;
        },
        data() {
            return {
                cPage: 1
            }
        },
        methods: {
            // ...mapMutations(['SET_PAGE_SIZE']),
            handleSizeChange(val) {
                this.SET_PAGE_SIZE(val);
                this.cPage = 1;
                this.$emit('changePage', this.cPage);
            },
            handleCurrentChange(val) {
                this.cPage = val;
                this.$emit('changePage', val);
            },
            initCpage() {
                this.cPage = 1;
            }
        },
        mounted() {
            this.$emit('changePage', this.cPage);
        },
    }
</script>

<style scoped>

</style>
